package com.lagou.edu.zdy.rpc;

import com.lagou.edu.zdy.util.RpcRequest;

public class ClientBootstrap {
//    public static final String providerName = "UserService#syaHello#";
    public static void main(String[] args) throws InterruptedException {
        RpcConsumer rpcConsumer = new RpcConsumer();

        RpcRequest rpcRequest = new RpcRequest();
        rpcRequest.setRequestId("test1");
        rpcRequest.setClassName("UserService");
        rpcRequest.setMethodName("sayHello");
        //创建一个代理对象
        UserService service =(UserService)
            rpcConsumer.createProxy(UserService.class, rpcRequest);

        for(;;){
            Thread.sleep(1000);
            System.out.println("客户端收到响应消息: "+service.sayHello("are you ok ？"));
        }
    }
}
